package com.ybwh.springboot2.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.converters.bigdecimal.BigDecimalNumberConverter;
import com.alibaba.fastjson2.JSON;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * 导入自定义还款计划
 *
 * @author Fan Beibei
 * @date 2023-09-01 16:36:17
 */
@Data
public class CustomRepayScheduleImport implements Serializable {

    // 导入必须配置index，导出可以不配
    @ExcelProperty(value = "还款期数")
    private Integer loanTerm;
    @ExcelProperty(value = "应还日期", converter = LocalDateConverter.class)
    @DateTimeFormat("yyyy-MM-dd")
    private LocalDate remainRepayDate;
    @ExcelProperty(value = "应还本金", converter = BigDecimalNumberConverter.class)
    private BigDecimal remainPrincipal;
    @ExcelProperty(value = "应还利息", converter = BigDecimalNumberConverter.class)
    private BigDecimal remainInterest;

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

}